//
//  ZhuBoBangDanViewController.m
//  喜马拉雅FM
//
//  Created by dllo on 16/3/3.
//  Copyright © 2016年 lanou.com. All rights reserved.
//

#import "ZhuBoBangDanViewController.h"

#import "CellForTypeOfDetail.h"

#import "ZhuBoInformationViewController.h"
#import "ModeForZhuBoBangDan.h"

@interface ZhuBoBangDanViewController ()<UITableViewDataSource,UITableViewDelegate>

@property (nonatomic, retain) UITableView *tableView;

@end

@implementation ZhuBoBangDanViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self createTableView];
}

- (void)createTableView {
    
    
    self.tableView = [[UITableView alloc]initWithFrame:self.view.bounds style:UITableViewStylePlain];
    [self.view addSubview:self.tableView];
    [self.tableView release];
    
    
    self.tableView.dataSource = self;
    self.tableView.delegate = self;
    
    
    [self.tableView registerClass:[CellForTypeOfDetail class] forCellReuseIdentifier:@"poolForCellTypeOfDetail"];
    
}

#pragma mark tableViewDataSource

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    
    return self.arrForZhuBoBangDan.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    ModeForZhuBoBangDan *model = [self.arrForZhuBoBangDan objectAtIndex:indexPath.row];
    CellForTypeOfDetail *cell = [tableView dequeueReusableCellWithIdentifier:@"poolForCellTypeOfDetail"];
    [cell passModelForZhuBoBangDan:model];
    return cell;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    return 100;
}


- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    
    ModeForZhuBoBangDan *model = [self.arrForZhuBoBangDan objectAtIndex:indexPath.row];
    ZhuBoInformationViewController *zhuBo = [[ZhuBoInformationViewController alloc]init];
    zhuBo.stringUid = model.uid;
    [self.navigationController pushViewController:zhuBo animated:YES];
}




- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
